<template>
	<view class="content">
		<image src="../../../static/home/home-bg.jpg" mode="widthFix" class="top-img"></image>
		<CustomNav :topBgColor="topBgColor" :color="titleColor" :backColor="'#999'" :isBack="true" :custom="custom"
			:title="'我要投诉'"></CustomNav>
		<view class="info-block">
			<view class="text-block">
				<image src="../../../static/home/submit.png" class="submit-img"></image>
				<view class="submit">提交成功</view>
			</view>
			<view class="text-block">
				<view class="title-block">
					<view class="title">投诉编码：{{code}}</view>
					<view class="copy-item">
						<image src="../../../static/home/copy.png" class="copy-img"></image>
						<view class="copy" @click="copyMessage(code)">复制</view>
					</view>
				</view>
				<view class="text">投诉编码可在“进度查询”中查询此条投诉的进度，每条投诉仅有一个编码，请妥善保存。</view>
			</view>
			<view class="btn-item">
				<view class="btn" @click="switchTo('/pages/index/index')">返回首页</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getCustomNavData
	} from '@/util/util.js'
	export default {
		data() {
			return {
				custom: null,
				topBgColor: 'rgba(0,0,0,0)',
				titleColor: '#fff',
				code: ''
			}
		},
		onPageScroll(e) {
			if (e.scrollTop >= 50) {
				this.topBgColor = '#117DFF';
			} else {
				this.topBgColor = 'rgba(0,0,0,0)';
			}
		},
		methods: {
			switchTo(url) {
				uni.switchTab({
					url
				});
			},
			copyMessage(value) {
				uni.setClipboardData({
					data: value,
					success: function(res) {
						uni.getClipboardData({
							success: function(res) {
								uni.showToast({
									title: "复制成功",
								});
							},
						});
					},
				});
			},
		},
		onLoad(e) {
			this.custom = getCustomNavData();
			this.code = e.code
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;

		.top-img {
			width: 100%;
		}

		.info-block {
			display: flex;
			flex-direction: column;
			background: #F5F5F5;
			margin-top: -200rpx;
			border-radius: 60rpx;
			position: relative;
			padding: 30rpx;

			.menu-block {
				display: flex;
				background: #fff;
				border-radius: 30rpx;
				position: relative;
				padding: 40rpx;
				background: #fff;
				justify-content: center;

				.menu-item1 {
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;

					.round {
						width: 50rpx;
						height: 50rpx;
						color: #fff;
						border-radius: 50%;
						background-color: #027BFF;
						display: flex;
						align-items: center;
						justify-content: center;
					}

					.txt {
						color: #027BFF;
						font-size: 32rpx;
						margin-top: 20rpx;
					}
				}

				.menu-item {
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;

					.round {
						width: 50rpx;
						height: 50rpx;
						color: #fff;
						border-radius: 50%;
						background-color: #D8D8D8;
						display: flex;
						align-items: center;
						justify-content: center;
					}

					.txt {
						color: #D8D8D8;
						font-size: 32rpx;
						margin-top: 20rpx;
					}
				}

				.line {
					width: 100rpx;
					height: 2rpx;
					background-color: #D8D8D8;
					margin-top: 30rpx;
				}
			}

			.text-block {
				display: flex;
				flex-direction: column;
				background: #fff;
				border-radius: 30rpx;
				padding: 30rpx;
				background: #fff;
				margin-top: 30rpx;
				align-items: center;

				.submit-img {
					width: 170rpx;
					height: 170rpx;
					margin: 40rpx auto;
				}

				.submit {
					font-weight: bold;
					margin-bottom: 30rpx;
				}

				.title-block {
					display: flex;
					justify-content: center;

					.title {
						font-weight: bold;
					}

					.copy-item {
						display: flex;
						background: #D9EBFF;
						border-radius: 20rpx;
						padding: 4rpx 8rpx;
						align-items: center;

						.copy-img {
							width: 26rpx;
							height: 26rpx;
						}

						.copy {
							color: #027BFF;
						}
					}
				}

				.text {
					text-indent: 60rpx;
					margin-top: 20rpx;
					line-height: 60rpx;
				}
			}

			.btn-item {
				width: 100%;
				display: flex;
				justify-content: center;
				margin-bottom: 50rpx;
				margin-top: 60rpx;

				.btn {
					width: 300rpx;
					height: 80rpx;
					background: #027BFF;
					color: #fff;
					display: flex;
					justify-content: center;
					align-items: center;
					border-radius: 60rpx;
				}
			}
		}
	}
</style>